# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kxmlgui5
pkgver=5.113.0
pkgrel=0
pkgdesc="User configurable main windows"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later"
depends_dev="
	attica5-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcoreaddons5-dev
	kglobalaccel5-dev
	ki18n5-dev
	kiconthemes5-dev
	kitemviews5-dev
	ktextwidgets5-dev
	kwidgetsaddons5-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
checkdepends="
	mesa-dri-gallium
	xvfb-run
	"
_repo_url="https://invent.kde.org/frameworks/kxmlgui.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kxmlgui-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/kxmlgui-$pkgver"

replaces="kxmlgui<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# kxmlgui_unittest, ktoolbar_unittest and ktooltiphelper_unittest are broken
	LC_ALL=C xvfb-run ctest --test-dir build --output-on-failure -E '(kxmlgui|ktoolbar|ktooltiphelper)_unittest'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
35c18ccabcc51b70b12e5b5faa8534e2f6793e916d97fc8ad6a1f5001b500f61f730006741f105fd40f37cef29524677bf2dca76093bbe12277c907378c87624  kxmlgui-5.113.0.tar.xz
"
